/**
 * @returns 是否是pc端
 */
export const verifyPc = () => {
  const deviceModel = uni.getSystemInfoSync().deviceModel;
  return deviceModel === "PC";
};

/**
 * @returns 是否是APP端
 */
export const isAPP = () => {
  let flag = false;
  //#ifdef  APP-PLUS
  flag = true;
  //#endif
  return flag;
};

/**
 * @returns 用户是否有对应权限
 */
export const isPermission = code => {
  return useAuthStore().authButtonList.includes(code);
};

/**
 * @description: 验证版本号是否一致 不一致更新版本号并刷新页面
 */
export const isSameVersion = async () => {
  // const oldVersion = uni.getStorageSync("version");
  // const data: any = await versionSearch();
  // if (data.version != oldVersion) {
  //   window.location.reload();
  //   uni.setStorageSync("version", data.version);
  // }
  // useGlobalStore().setGlobalState("getVersion", false);
};

/**
 * @description: 是否是开发环境
 * @return {*}
 */
export const isDev = () => {
  return process.env.NODE_ENV === "development";
};
